package com.model.information;

import com.jdbc.bean.InformationBean;
import com.jdbc.dao.InformationDao;
import com.jdbc.dao.impl.InformationDAOImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 资讯网络控制
 * Created by CCX on 2018/7/1.
 */
@Controller
public class InformationController {

    @RequestMapping(value = "/access_to_information.json" ,method = RequestMethod.GET)
    @ResponseBody
    public String getAccessInformation(long id){
        InformationDao impl=new InformationDAOImpl();
        InformationBean bean= impl.getInformationById(id);
        if(bean!=null){
            return bean.toString();
        }else{
            return "12345";
        }

    }

}
